﻿using System;
using System.Collections.Generic;
using System.Text;
using Hangfire;

namespace KelonProud.BackgroundJobs.Jobs.Base
{
    public abstract class ScheduleJobBase
    { /// <summary>
        /// 时间间隔
        /// </summary>
        public abstract TimeSpan TimeSpan{ get; set; }

        public abstract void Execute();

        public virtual void Init()
        {
            BackgroundJob.Schedule(() => Execute(), TimeSpan);
        }
    }
}
